<cfscript>    
    view = createObject("component", session.rootDir & ".views.layout");
    if( Session.Auth EQ True and (Session.strAuthType EQ Session.MANAGERS or Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR or Session.Manager) ){
        view.init("Step 3:  HR - Manual EPLS Check","/#session.rootDir#/static/js/scf/Step3-OrientationEPLSFailed.js","","Home",index);
    }else{
        view.init("Denied","","","Home","Denied");
    }    
    view.html();
</cfscript>

<cffunction name="index" access="public" output="true" returntype="any">
    <cfscript>
        import models.*;
        helperTools = CreateObject("component", session.RootDir & ".utilities.helperTools");
        KronosQueries = CreateObject("component", session.rootDir & ".DatabaseQueries.Kronos");
        AccessControlQueries = CreateObject("component", session.rootDir & ".DatabaseQueries.AccessControl");
        JustinsJobProg = CreateObject("component", session.rootDir & ".DatabaseQueries.JustinsJobProg");
        StepActions = ORMExecuteQuery("FROM StepActions WHERE StepID = 16 AND ActTimeStamp IS NULL");
        if( isDefined('URL.StepID') ){
            StepActions = ORMExecuteQuery("FROM StepActions WHERE StepActionsID = " & URL.StepID & " AND ActTimeStamp IS NULL");
            Employee = ORMExecuteQuery("FROM Employee WHERE EmployeeID = " & StepActions[1].getEmployeeID());
        }else{
            StepActions = ORMExecuteQuery("FROM StepActions WHERE StepID = 16 AND ActTimeStamp IS NULL");
            URL.StepID = -1;
        }
        FormAction = '/' & Session.RootDir & "/controller/SubmitHandler.cfm?SCFStep3=EPLS";
    </cfscript>
    
    <cfoutput>
    <h1 class="title">Step 3:  HR - Manual EPLS Check</h1>
    <div class="entry">
        The employee, '#Employee[1].getFullName()#', had one or more hits on the EPLS exclusion list 
        as part of the E-PAR automated check.  You'll need to complete a manual 
        check for this employee.  Follow the instructions below to complete this 
        step.  This a list of the possible matches:  <br />
        
        <cfform name="frmEPLS" method="post">
            <table cellpadding="0" cellspacing="0" width=100%>
                <tr>
                    <td colspan="3">
                        <table cellpadding="1" cellspacing="1" width=100%>
                            <tr>
                                <td><strong><u>SCF Name</u></strong></td>
                                <td><strong><u>EPLS Name</u></strong></td>
                                <td><strong><u>SSN</u></strong></td>
                                <td><strong><u>EPLS Error Message</u></strong></td>
                            </tr>
                            <cfloop from=1 to=#arrayLen(StepActions)# index="i">
                                <cfset EPLSCleared = helperTools.EPLSCheck(
                                    '#Employee[1].getFirstName()#', '#Employee[1].getLastName()#', '#Employee[1].getSSN()#', #Employee[1].getEmployeeID()#
                                ) />
                                <tr>
                                    <td valign="top" nowrap="nowrap">#Employee[1].getFullName()#</td>
                                    <td valign="top" nowrap="nowrap">#Employee[1].getFirstName()# #Employee[1].getFirstName()#</td>
                                    <td valign="top">#Employee[1].getSSN()#</td>
                                    <td valign="top">
                                        <cfif !EPLSCleared >
                                            <em>Possible Exact Match</em>
                                        <cfelse>
                                            <em>Not matches found.</em>
                                        </cfif>
                                    </td>
                                </tr>
                            </cfloop>
                        </table>
                    </td>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="3" nowrap="nowrap">1) Search for the employee at the EPLS site (using the EPLS Name <em>exactly</em>):&nbsp;&nbsp;<a href="http://www.epls.gov/epls/search.do?ssn=true" target="_blank">EPLS Advanced SSN Search</a></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="3">2) Did the employee pass or fail the EPLS check?</td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;&nbsp;&nbsp;&nbsp;<cfinput type="radio" name="EPLS" checked="yes" value="1" tabindex="10"> Passed (Does not appear on the EPLS List - Continue to the Next Step)<BR />
                        &nbsp;&nbsp;&nbsp;&nbsp;<cfinput type="radio" name="EPLS" value="0" tabindex="20"> Failed (Appears on the EPLS List - Notify HR Management)
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td nowrap="nowrap" valign="top" colspan="3">
                        3) HR Comments:<BR />
                        &nbsp;&nbsp;&nbsp;&nbsp;<cftextarea name="Comments" style="width:96%" tabindex="30"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" align="right">
                        <cfinput type="hidden" name="FormAction" value="#FormAction#">
                        <cfinput type="hidden" name="StepID" value="#URL.StepID#">
                        <cfinput type="button" name="Submit" value="Next >>" tabindex="40">
                    </td>
                </tr>
            </table>
        </cfform>
    </div>
    </cfoutput>
    
</cffunction>